package ace.module.account.core.impl.api.impl;

import ace.cmp.core.model.PageResultDto;
import ace.cmp.core.model.R;
import ace.module.account.api.IamAccountPassportApi;
import ace.module.account.api.model.dto.IamAccountPassportDto;
import ace.module.account.api.model.input.passport.IamAccountPassportSearchOutInput;
import ace.module.account.core.impl.dao.entity.IamAccountPassport;
import ace.module.account.core.impl.manager.IamAccountPassportManager;
import ace.module.account.core.impl.service.IamAccountPassportService;
import ace.module.common.api.annotation.ApiLocalPriority;
import ace.module.common.api.model.input.PageInput;
import ace.module.common.core.impl.api.impl.SdkApiImpl;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;


/**
 * 账户通过证 api implements.
 *
 * @author Caspar
 *
 */
@ApiLocalPriority
@AllArgsConstructor
@Component
public class IamAccountPassportApiImpl
    extends SdkApiImpl<IamAccountPassport, Long, IamAccountPassportDto, IamAccountPassportManager>
    implements IamAccountPassportApi {

  private final IamAccountPassportService iamAccountPassportService;

  @Override
  public R<IamAccountPassportDto> getByIamAppIdAndPassport123AndPassportType(
      Long iamAppId,
      String passport,
      String passport2,
      String passport3,
      Integer passportType) {
    IamAccountPassportDto accountPassportDto = iamAccountPassportService.getByIamAppIdAndPassport123AndPassportType(iamAppId, passport, passport2, passport3, passportType);
    return R.ok(accountPassportDto);
  }

  @Override
  public R<PageResultDto<IamAccountPassportDto>> search(PageInput<IamAccountPassportSearchOutInput> input) {
    return iamAccountPassportService.search(input);
  }
}
